<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
        border: 3px solid rgb(211, 15, 54);
        width: 1000px;
        height: 500px;
        background-color: rgb(95, 171, 110);
      }
      .content {
        position: relative;
       animation-name:myFirst;
       animation-duration: 4s;
       animation-timing-function: linear;
       animation-iteration-count: infinite;
      }
      @keyframes myFirst{
        0% {

        }
        25% {
          transform: translate(900px, 200px);
          animation-direction: reverse;
        }

        50% {
          transform: translate(0px, 400px);
          animation-direction: normal;
        }
        75% {
          transform: translate(900px, 200px);
        }
      }
    </style>
</head>
<body>
    <div class="container" >
        <div class="content">
            <img  src="girlfriend.jpg" id="img" width="100px" height="100px"
              style="border: 1px solid #fff" />
            </div>
    </div>
</body>
</html>